package it.unibo.imola.parser.visitor.entity;


public class BuiltinCallStatementFactory {

	public static BuiltinCallStatement create(String callName, ToolBox toolbox) {
		switch (BuiltInOperators.valueOf(callName)) {
		case LOAD:
			return new LoadStatement(toolbox);
		case SAVE:
			return new SaveStatement(toolbox);
		case SHOW:
			return new ShowStatement(toolbox);
		case CLOSE:
			return new CloseStatement(toolbox);
		case CLOSEALL:
			return new CloseAllStatement(toolbox);
		case WAITKEY:
			return new WaitKeyStatement(toolbox);
		case IID_NOISE:
			return new IIDNoiseStatement(toolbox);
		case IMP_NOISE:
			return new IMPNoiseStatement(toolbox);
		case ERODE:
			return new ErodeStatement(toolbox);
		case DILATE:
			return new DilateStatement(toolbox);
		case GLOBAL_THRES:
			return new GlobalThresStatement(toolbox);
		case CONTRAST_STRETCH:
			return new ContrastStretchStatement(toolbox);
		case EQUALIZE:
			return new EqualizeStatement(toolbox);
		case MEAN_SMOOTHING:
			return new MeanSmoothingStatement(toolbox);
		case GAUSS_SMOOTHING:
			return new GaussSmoothingStatement(toolbox);
		case BILATERAL_SMOOTHING:
			return new BilateralSmoothingStatement(toolbox);
		case MEDIAN_SMOOTHING:
			return new MedianSmoothingStatement(toolbox);
		case SUM:
			return new SumStatement(toolbox);
		case DIFF:
			return new DiffStatement(toolbox);
		case ABSDIFF:
			return new AbsDiffStatement(toolbox);
		case AND:
			return new AndStatement(toolbox);
		case OR:
			return new OrStatement(toolbox);
		case NOT:
			return new NotStatement(toolbox);
		case SET:
			return new SetStatement(toolbox);
		case INVERT:
			return new InvertStatement(toolbox);
		case COPY:
			return new CopyStatement(toolbox);
		}
		return null;
	}

}

enum BuiltInOperators {
	LOAD, SAVE, SHOW, CLOSE, CLOSEALL, WAITKEY, IID_NOISE, IMP_NOISE, ERODE, DILATE, GLOBAL_THRES, CONTRAST_STRETCH, EQUALIZE, MEAN_SMOOTHING, GAUSS_SMOOTHING, BILATERAL_SMOOTHING, MEDIAN_SMOOTHING, SUM, DIFF, ABSDIFF, AND, OR, NOT, SET, INVERT, COPY
}
